import Base from '../../utils/base.js';
const http = new Base();
var app = getApp();
Page({
    data: {
        "content": "非常愉快的订餐体验~~",
        "score": 10,
        "order_sn": ""
    },
    onLoad: function (e) {
        var that = this;
        that.setData({
            order_sn: e.order_sn
        });
    },
    scoreChange: function (e) {
        this.setData({
            "score": e.detail.value
        });
    },
    contentBlur: function ( e ) {
        app.console( e );
        this.setData({
            content: e.detail.value
        });
    },
    doComment: function () {
        var that = this;
        http.request({
            url: '/my/add_comment',
            method: 'POST',
            data: {
                'content': that.data.content,
                'score': that.data.score,
                'order_sn': that.data.order_sn
            },
            sCallback: res => {
                wx.navigateTo({
                    url: '/pages/my/commentList'
                });
            },
            eCallback: res => {
                app.alert({'content': res.msg});
            }
        });
    }
});